package com.synergy.stockflow.production.service.impl;

import com.synergy.stockflow.production.create.ProductionPlanDetailDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.synergy.stockflow.production.entity.ProductionPlanDetail;
import com.synergy.stockflow.production.mapper.ProductionPlanDetailMapper;
import com.synergy.stockflow.production.service.ProductionPlanDetailService;
@Service
public class ProductionPlanDetailServiceImpl extends ServiceImpl<ProductionPlanDetailMapper, ProductionPlanDetail> implements ProductionPlanDetailService{

    @Override
    public List<ProductionPlanDetailDTO> selectByPlanCode(String planCode) {
        return baseMapper.selectByPlanCode(planCode);
    }

    @Override
    public  List<ProductionPlanDetail> selectByPlanId(String planId){
        return baseMapper.selectByPlanId(planId);
    }

    @Override
    public ProductionPlanDetail getByPlanId(String planId){
        return baseMapper.getByPlanId(planId);
    }

    @Override
    public int updateByPlanId(@Param("actualQuantity") BigDecimal actualQuantity,
                              @Param("completedQuantity")BigDecimal completedQuantity,
                              @Param("planId")String planId){
        return baseMapper.updateByPlanId(actualQuantity,completedQuantity,planId);
    }
}
